package eu.irreality.dai.gameplay.controller.actions.movement;

import eu.irreality.dai.gameplay.actions.movement.ConcreteMovementAction;
import eu.irreality.dai.gameplay.controller.actions.ControllerAction;
import eu.irreality.dai.gameplay.entities.AliveEntity;
import eu.irreality.dai.gameplay.world.GameWorld;
import eu.irreality.dai.ui.keyboard.KeyProcessor;
import eu.irreality.dai.util.Position;

public abstract class MovementAction extends ControllerAction
{

    public MovementAction(KeyProcessor kp, GameWorld world, AliveEntity entity)
    {
	super(kp, world, entity);
    }

    public void execute()
    {
	Position destPos = getDestinationPosition();
	new ConcreteMovementAction(world, entity, destPos).execute();
    }

    protected abstract Position getDestinationPosition();

}
